<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%
	request.setCharacterEncoding("UTF-8");	
	String htmlData = request.getParameter("content1") != null ? request.getParameter("content1") : ""; 
%>
<!DOCTYPE HTML>
<html>
  <head>
    <%@include file="../common.jsp"%>
    <title>添加章节</title>
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">  
 	<link rel="stylesheet" type="text/css" href="resources/css/common.css">
	<script type="text/javascript" src="resources/js/course/add_course.js"></script>  
	
	<!--kindEditor -->
    <link rel="stylesheet" href="resources/js/kindeditor/themes/default/default.css" />
	<link rel="stylesheet" href="resources/js/kindeditor/plugins/code/prettify.css" />
	<script charset="utf-8" src="resources/js/kindeditor/kindeditor.js"></script>
	<script charset="utf-8" src="resources/js/kindeditor/lang/zh_CN.js"></script>
	<script charset="utf-8" src="resources/js/kindeditor/plugins/code/prettify.js"></script> 
	
	<script type="text/javascript" src="resources/js/jquery.tagbox.js"></script>  
	<link rel="stylesheet" type="text/css" href="resources/css/jquery.tagbox.css">


	<link rel="stylesheet" href="resources/js/ztree/css/zTreeStyle.css" type="text/css">
	<script type="text/javascript" src="resources/js/jquery.ztree.core.js"></script>
	<script type="text/javascript" src="resources/js/jquery.ztree.excheck.js"></script>
	<script type="text/javascript" src="resources/js/jquery.ztree.exedit.js"></script>
	
	<style type="text/css">
		.ztree li span.button.add {margin-left:2px; margin-right: -1px; background-position:-144px 0; vertical-align:top; *vertical-align:middle}
	</style>
	<script>
	var courseId = ${courseId};
	</script>
  </head>
  <body>
	<div class="content">
   		<ol class="breadcrumb">
		  <li><a href="course.htm">课程列表</a></li>
		  <li class="active">添加章节</li>
		</ol>
		<!-- 添加 -->
		<div class="modal-body" style="margin-left:50px;">
		<div id="itemFileName" ></div>
<!-- 			<div style="height:50px;">
				<ul id="theList"></ul>
			</div>
			<div id="uploader">
				<button id="picker" resetValue="0" class="btn btn-primary ">选择文件</button>
			</div> -->
			
			<div class="zTreeDemoBackground left">
					<ul id="treeDemo" class="ztree"></ul>
			</div>
		</div>

		<div class="modal-content">
			<div class="modal-body">
				<form id="form_add" class="form-horizontal" role="form">
				<input type="hidden" name="url" id="url">
				<input type="hidden" id="fileSize">
				<input type="hidden" name="mold" value="2" id = "mold">
				<div class="form-group">
						  <label class="col-sm-2 control-label required">文件标题</label>
						  <div class="col-sm-4">
						     <input type="text" name="name" placeholder="50字以内,如:建筑设计" class="form-control" data-toggle="tooltip" data-placement="top" title="请输入不多于50个字" >
						  </div>
						  <label class="col-sm-2 control-label required">文件格式</label>
						  <div class="col-sm-4">
							<select class="form-control" name="type" placeholder="选择文件格式" data-toggle="tooltip" data-placement="top" title="请选择文件格式">
								<option value="0" selected="selected">请选择...</option>
							</select> 
						</div>
					  </div>					  
				  	  <div class="form-group">
						<label class="col-sm-2 control-label">价格</label>
						  <div class="col-sm-4">
							 <input type="text" name="price" class="form-control">
						  </div>
						  
						  <label class="col-sm-2 control-label required">浏览的基数</label>
						  	<div class="col-sm-4">
								<input type="text" name="cardinal" placeholder="" class="form-control" data-toggle="tooltip" data-placement="top" title="请输入浏览基数"> 
							</div>
					  </div>
					  
				  	  <div class="form-group">
						  <label class="col-sm-2 control-label required">标签</label>
						  <div class="col-sm-10">
							<div class="row"></div>
						  </div>
					  </div>
					  
				  	  <div class="form-group">
						  <label class="col-sm-2 control-label required">文件简介</label>
						  <div class="col-sm-10">
							<%=htmlData%>
							<!-- <form name="example" method="post" action="file_list.jsp"> -->
								<textarea id ="introduction" name="content1" cols="100" rows="8" style="width:100%;height:400px;"><%=htmlspecialchars(htmlData)%></textarea>
								<br />
								<!--<input type="submit" name="button" value="提交内容" /> (提交快捷键: Ctrl + Enter)
							 </form>	 -->				
						</div>
					  </div>
				</form>
		      </div>
			<div class="modal-footer">
				<button id="btn_confirm_add" type="button" class="btn btn-primary">确定</button>
			</div>
		</div>
	</div>
  </body>
</html>

<%!
private String htmlspecialchars(String str) {
	str = str.replaceAll("&", "&amp;");
	str = str.replaceAll("<", "&lt;");
	str = str.replaceAll(">", "&gt;");
	str = str.replaceAll("\"", "&quot;");
	return str;
}
%>